package com.iccct.cloud.user.controller;

import com.iccct.cloud.commons.result.OKResponse;
import com.iccct.cloud.commons.result.Response;
import com.iccct.cloud.user.model.Menu;
import com.iccct.cloud.user.model.resp.MenuResp;
import com.iccct.cloud.user.service.MenuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author iccct (taowutt1@gmail.com)
 * @since 2021-11-08  14:27
 */
@RestController
@RequestMapping("user")
public class MenuController {
    @Resource
    private MenuService menuService;

    @GetMapping("/getRightsList")
    public Response getRightList(){
        List<MenuResp> menuList = menuService.getMenuList();
        return OKResponse.QUERY.toResponse(menuList);
    }
}
